package com.lazy.utils.lock;

import java.util.concurrent.TimeUnit;

/**
 * 分布式锁
 * @author wql
 * @since 2018-02-05 15:52
 */
public interface DistributedLockService {

    void lock(String lockKey);

    void unlock(String lockKey);

    void lock(String lockKey, int timeout);

    void lock(String lockKey, TimeUnit unit, int timeout);

    boolean tryLock(String lockKey);

    boolean tryLock(String lockKey, int tryTimeOut, int timeout, TimeUnit unit) throws InterruptedException;

}
